From 63c3e24b3b37182e38e821c5286a17dcd153aa94 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 6 Mar 2008 03:40:05 +0000 Subject: [PATCH] KML: nail directional icons to map for rotation. Don't crash on GPX files that have links w/o text. Bump version. --- gpsbabel/configure | 2 +- gpsbabel/configure.in | 2 +- gpsbabel/gbversion.h | 2 +- gpsbabel/kml.c | 29 +++++++++++++++++++---------- gpsbabel/testo | 2 +- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/gpsbabel/configure b/gpsbabel/configure index 19be3ea6c..a7bb3a6e7 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -1744,7 +1744,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # YYYYMMDD, please, if beta, i.e. "-beta20060413" -PACKAGE_RELEASE="-beta20080217" +PACKAGE_RELEASE="-beta20080305" cat >>confdefs.h <<_ACEOF #define PACKAGE_RELEASE "$PACKAGE_RELEASE" diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index 71af6daf3..c2556113d 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -6,7 +6,7 @@ AC_PREREQ(2.59) AC_INIT(GPSBabel, 1.3.5, BUG-REPORT-ADDRESS) # YYYYMMDD, please, if beta, i.e. "-beta20060413" -PACKAGE_RELEASE="-beta20080217" +PACKAGE_RELEASE="-beta20080305" AC_DEFINE_UNQUOTED(PACKAGE_RELEASE, "$PACKAGE_RELEASE", [Define to the release name of this package.]) AC_SUBST(PACKAGE_RELEASE) diff --git a/gpsbabel/gbversion.h b/gpsbabel/gbversion.h index da86fcbac..e7a13d1b4 100644 --- a/gpsbabel/gbversion.h +++ b/gpsbabel/gbversion.h @@ -4,5 +4,5 @@ * * Isn't simplification via automation grand? */ -#define VERSION "1.3.5-beta20080217" +#define VERSION "1.3.5-beta20080305" #define WEB_DOC_DIR "http://www.gpsbabel.org/htmldoc-1.3.5" diff --git a/gpsbabel/kml.c b/gpsbabel/kml.c index 88dffe405..102f1ca2a 100644 --- a/gpsbabel/kml.c +++ b/gpsbabel/kml.c @@ -402,7 +402,7 @@ kml_write_xmle(const char *tag, const char *v) #define hovertag(h) h ? 'h' : 'n' static void kml_write_bitmap_style_(const char *style, const char * bitmap, - int highlighted) + int highlighted, int force_heading) { kml_write_xml(0, "\n", highlighted ? "Highlighted" : "Normal", style); @@ -411,6 +411,10 @@ static void kml_write_bitmap_style_(const char *style, const char * bitmap, if (highlighted) { kml_write_xml(0, "1.2\n"); } + /* Our icons are pre-rotated, so nail them to the maps. */ + if (force_heading) { + kml_write_xml(0, "0\n"); + } kml_write_xml(1, "\n"); kml_write_xml(0, "%s\n", bitmap); kml_write_xml(-1, "\n"); @@ -425,17 +429,18 @@ static void kml_write_bitmap_style_(const char *style, const char * bitmap, static void kml_write_bitmap_style(kml_point_type pt_type, const char *bitmap, const char *customstyle) { + int force_heading = 0; const char *style; switch (pt_type) { case kmlpt_track: style = "track"; break; case kmlpt_route: style = "route"; break; case kmlpt_waypoint: style = "waypoint"; break; - case kmlpt_other: style = customstyle; break; + case kmlpt_other: style = customstyle; force_heading = 1; break; default: fatal("kml_output_point: unknown point type"); break; } - kml_write_bitmap_style_(style, bitmap, 0); - kml_write_bitmap_style_(style, bitmap, 1); + kml_write_bitmap_style_(style, bitmap, 0, force_heading); + kml_write_bitmap_style_(style, bitmap, 1, force_heading); kml_write_xml(1, "\n", style); kml_write_xml(1, "\n"); @@ -851,13 +856,17 @@ static void kml_geocache_pr(const waypoint *waypointp) kml_write_xml(1, "\n"); kml_write_xml(0, "%s\n", waypointp->shortname); - p = xml_entitize(waypointp->url_link_text); - kml_write_xml(0, "%s\n", p); - xfree(p); + if(waypointp->url_link_text) { + p = xml_entitize(waypointp->url_link_text); + kml_write_xml(0, "%s\n", p); + xfree(p); + } - p = xml_entitize(waypointp->gc_data.placer); - kml_write_xml(0, "%s\n", p); - xfree(p); + if (waypointp->gc_data.placer) { + p = xml_entitize(waypointp->gc_data.placer); + kml_write_xml(0, "%s\n", p); + xfree(p); + } kml_write_xml(0, "%d\n", waypointp->gc_data.placer_id); diff --git a/gpsbabel/testo b/gpsbabel/testo index 5e5cd0dc1..e9b3ca012 100755 --- a/gpsbabel/testo +++ b/gpsbabel/testo @@ -1289,7 +1289,7 @@ compare ${TMPDIR}/navilink_tracks_gpx.trk ${REFERENCE}/navilink_tracks_gpx.trk # MTK logger tests # rm -f ${TMPDIR}/mtk_logger.* -${PNAME} -t -i mtk-bin,csv=${TMPDIR}/mtk_logger.csv -f ${REFERENCE}/track/mtk_logger.bin -o gpx -F ${TMPDIR}/mtk_logger.gpx +${PNAME} -t -w -i mtk-bin,csv=${TMPDIR}/mtk_logger.csv -f ${REFERENCE}/track/mtk_logger.bin -o gpx -F ${TMPDIR}/mtk_logger.gpx compare ${TMPDIR}/mtk_logger.gpx ${REFERENCE}/track/mtk_logger.gpx ## CSV compare needs to be done with '-w' - ignore whitespace. compare ${TMPDIR}/mtk_logger.csv ${REFERENCE}/track/mtk_logger.csv -- 2.30.2